// Copyright 2011 Jefferson Willian
// willmont7@gmail.com

#include <cstdio>

#define MAX 10000

/* Verifica se um retangulo tem alguma area que projeta sobre o limite */
bool verifyLimit(int entrada[], int limit[]) {
  if (entrada[0] >= limit[2])
    return false;

  if (entrada[2] <= limit[0])
    return false;

  if (entrada[1] <= limit[3])
    return false;

  if (entrada[3] >= limit[1])
    return false;

  return true;
}

int main() {
  int limit[4];
  int in[4];
  int n;
  bool ok;
  int games = 1;

  while (scanf("%d", &n) && n != 0) {
    limit[0] = -MAX;
    limit[1] = MAX;
    limit[2] = MAX;
    limit[3] = -MAX;

    ok = true;

    for (int i = 0;i < n;i++) {
      scanf("%d%d%d%d", &in[0], &in[1], &in[2], &in[3]);

      if (!ok)
        continue;

      ok = verifyLimit(in, limit);

      if (in[0] > limit[0])
        limit[0] = in[0];
      if (in[2] < limit[2])
        limit[2] = in[2];
      if (in[3] > limit[3])
        limit[3] = in[3];
      if (in[1] < limit[1])
        limit[1] = in[1];
    }

    if (!ok)
      printf("Teste %d\nnenhum\n\n", games++);
    else
      printf("Teste %d\n%d %d %d %d\n\n", games++, limit[0], limit[1], limit[2], limit[3]);
  }

  return 0;
}
